<?php
namespace app\common\model;

class NoticeLeave extends Base
{
    protected $hidden = [
        'update_time', 'user_id'
    ];

    public static function getList($map = [])
    {

        $subQuery = self::alias('a')
            ->join('users u','u.user_id = a.user_id','LEFT')
            ->where($map)
            ->order('id desc, create_time desc')
            ->field('a.*,u.nick_name,u.header_img')
            ->buildSql();

        return  self::table($subQuery.' a')
            ->group('a.user_id')
            ->paginate('',false,['query'=>request()->param()]);

    }

}